package agenda.database.entities;

import java.util.Date;

import agenda.extra.Utils;

/**
 * @author sPeC!
 * 
 */
public class Aula
{

	private long id;
	private int weekDay;
	private Date startTime;
	private Date endTime;
	private String name;
	private String room;

	public long getId()
	{
		return id;
	}

	public int getWeekDay()
	{
		return weekDay;
	}

	public Date getStartTime()
	{
		return startTime;
	}

	public Date getEndTime()
	{
		return endTime;
	}

	public String getName()
	{
		return name;
	}

	public String getRoom()
	{
		return room;
	}

	public Aula(long id, int weekDay, String startTime, String endTime, String name, String room)
	{
	
		this.id = id;
		this.weekDay = weekDay;
		this.startTime = Utils.stringToTime(startTime);
		this.endTime = Utils.stringToTime(endTime);
		this.name = name;
		this.room = room;
	}

	public Aula(int id, String startTime, String endTime, int weekDay, String name, String room)
	{
		this.id = id;

	}

	public boolean overlaps(int weekDay, String startTime, String endTime)
	{
		Date start = Utils.stringToTime(startTime);
		Date end = Utils.stringToTime(endTime);

		return this.weekDay == weekDay && start.compareTo(this.endTime) <= 0 && this.startTime.compareTo(end) <= 0;
	}

}